﻿<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="index_conn.asp"-->
<%
username=Trim(Request.Form("username"))
UserFace=Trim(Request.Form("UserFace"))
phone=Trim(Request.Form("phone"))
address=Trim(Request.Form("address"))
email=Trim(Request.Form("email"))
company=Trim(Request.Form("company"))
N_title=Trim(Request.Form("N_title"))
detail=Trim(Request.Form("detail"))

Set rs = Server.CreateObject("ADODB.Recordset")
sql="select username,UserFace,phone,address,email,company,N_title,detail from Gbook where phone='"&phone&"'"
rs.open sql,conn,1,3
if not rs.eof then
Response.Write("<script>alert('您已经申请过，请不要重复提交！');window.location='"&request.ServerVariables("HTTP_REFERER")&"';</script>")
Response.End
else
rs.addnew
rs("username")=username
rs("UserFace")=UserFace
rs("phone")=phone
rs("address")=address
rs("email")=email
rs("company")=company
rs("N_title")=N_title
rs("detail")=detail
rs.update
end if
call rsclose(rs)

Set rs=Server.CreateObject("ADODB.RecordSet")
strsql="select zongshu from [Infor] where Web_ID=1"
rs.Open strsql,conn,1,3
if not (rs.bof and rs.eof) then
	rs("zongshu")=rs("zongshu")+1
rs.update
end if
call rsclose(rs)

Response.Write("<script>alert('申请成功！');window.location='"&request.ServerVariables("HTTP_REFERER")&"';</script>")
Response.End
%>